package com.fin.zw.aiqas.entity;

import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;
import java.util.Set;

@Entity
@Table(appliesTo = "template_info", comment = "样本信息")
@Data
public class TemplateInfo extends BaseEntity {

    @Column(columnDefinition = "varchar(500) COMMENT '样本内容'")
    private String content;

    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "template_formula", joinColumns = @JoinColumn(name = "template_id"), inverseJoinColumns = @JoinColumn(name = "formula_id"))
    private Set<FormulaInfo> formulaInfos;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "scenes_id", referencedColumnName = "id", columnDefinition = "bigint(64) COMMENT '应用场景ID'")
    private ScenesInfo scenesInfo;


}
